﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace exercice2
    {
    class Program
        {
        static void Main(string[] args)
            {
            double begin = -2.0;
            double end = 2.0;
            double step = 0.1;

            System.Console.WriteLine("x\tf(x)\tg(x)\th(x)\ti(x)"); 
            for (double x = begin; x <= end; x+=step)
                {
                double fx = f(x);
                double gx = g(x);
                double hx = h(x);
                double ix = i(fx, gx, hx);
                System.Console.WriteLine("{0:n1}\t{1:n1}\t{2:n1}\t{3:n2}\t{4:n1}",x,fx,gx,hx,ix);
                }

            System.Console.ReadKey();
            }

        static double f(double x)
            {
            return x;
            }

        static double g(double x)
            {
            return Math.Pow(x, 2);
            }

        static double h(double x)
            {
            return Math.Pow(Math.E, -Math.Sin(x));
            }

        static double i(double f, double g, double h)
            {
            return Math.Max(Math.Max(f, g), h);
            }
        }
    }